package com.aiit.dao;

import com.aiit.pojo.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Set;

@Mapper
public interface PermissionDao {

    /**
     * 根据用户Id查询该用户拥有的权限列表
     * @param userId
     * @return
     * @throws Exception
     */
  // @Select(" select p.permissioncode from t_permission as p\n inner join t_role_permission as rp on rp.permissionid=p.permissionid\n inner join t_user_role ur on ur.roleid = rp.roleid\n where ur.userid=#{userId}")
    Set<Permission> findPermissionListByUserId(@Param("userId") int userId) ;
}
